// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.Security
{
	public sealed class SecuritySamlAuthenticateRequestParameters : RequestParameters<SecuritySamlAuthenticateRequestParameters>
	{
	}

	public sealed partial class SecuritySamlAuthenticateRequest : PlainRequestBase<SecuritySamlAuthenticateRequestParameters>
	{
		internal override ApiUrls ApiUrls => ApiUrlsLookups.SecuritySamlAuthenticate;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override bool SupportsBody => true;
		[JsonInclude]
		[JsonPropertyName("content")]
		public string Content { get; set; }

		[JsonInclude]
		[JsonPropertyName("ids")]
		public Elastic.Clients.Elasticsearch.Ids Ids { get; set; }

		[JsonInclude]
		[JsonPropertyName("realm")]
		public string? Realm { get; set; }
	}

	public sealed partial class SecuritySamlAuthenticateRequestDescriptor : RequestDescriptorBase<SecuritySamlAuthenticateRequestDescriptor, SecuritySamlAuthenticateRequestParameters>
	{
		internal SecuritySamlAuthenticateRequestDescriptor(Action<SecuritySamlAuthenticateRequestDescriptor> configure) => configure.Invoke(this);
		public SecuritySamlAuthenticateRequestDescriptor()
		{
		}

		internal override ApiUrls ApiUrls => ApiUrlsLookups.SecuritySamlAuthenticate;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override bool SupportsBody => true;
		private string ContentValue { get; set; }

		private Elastic.Clients.Elasticsearch.Ids IdsValue { get; set; }

		private string? RealmValue { get; set; }

		public SecuritySamlAuthenticateRequestDescriptor Content(string content)
		{
			ContentValue = content;
			return Self;
		}

		public SecuritySamlAuthenticateRequestDescriptor Ids(Elastic.Clients.Elasticsearch.Ids ids)
		{
			IdsValue = ids;
			return Self;
		}

		public SecuritySamlAuthenticateRequestDescriptor Realm(string? realm)
		{
			RealmValue = realm;
			return Self;
		}

		protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
		{
			writer.WriteStartObject();
			writer.WritePropertyName("content");
			writer.WriteStringValue(ContentValue);
			writer.WritePropertyName("ids");
			JsonSerializer.Serialize(writer, IdsValue, options);
			if (!string.IsNullOrEmpty(RealmValue))
			{
				writer.WritePropertyName("realm");
				writer.WriteStringValue(RealmValue);
			}

			writer.WriteEndObject();
		}
	}
}